var userN='';


function showName(){

	
	
	var agoN = localStorage.getItem("state");
	 userN= $("#userFlag").val();
	if(userN!=''){
		
	$("#userName").text("Welcome "+userN);
	
	
	localStorage.setItem("state",userN);   //把用户名id放在cookie 记录登陆状态；
	}
	if(agoN!='')
		
		$("#userName").text("Welcome "+agoN);
	
	
	
}


$(document).ready(function(){
	
	$("#myZone").click(function(){
		
		var agoUserN = localStorage.getItem("state");
		
		if(agoUserN==userN&&agoUserN!=''&&userN!='')
		window.location.href = "./news-view/myzone.jsp?id="+agoUserN;
			//alert(agoUserN);
		else
			alert("您还没登陆");
		
	})
	
	
	
	
})